﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Marbles.Resources;

namespace Marbles.Web.Admin
{
    public partial class Default : Core.Pages.AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterClientScriptHeaderInclude("marblesApplication", Resources.ResourceHandler.GetApplicationJavascript(this));
            cLogin.Visible = !this.AuthenticationProvider.IsAuthenticated;
            
            if (!Page.IsPostBack)
            {
                InitialiseForm();
            }
        }

        private void InitialiseForm()
        {
            cPnlLogin.Visible = !this.AuthenticationProvider.IsAuthenticated; 
            cLogin.Visible = !this.AuthenticationProvider.IsAuthenticated;
            cLblFooter.Text = "Marbles.Net CMS &#8211; Version " + ResourceHandler.GetBuildVersion() + " (Build: " + Core.Settings.Environment.GetBuildDate().ToShortDateString() + ") &#8211; &copy;2010-2011 <a href=\"http://www.riaweb.co.uk\" style=\"text-decoration:none;color:inherit;\" target=\"_blank\">RiaWeb Systems</a>";
            cPnlFooter.Visible = cLogin.Visible;             
            cLnkNav.NavigateUrl = Request.Url.Scheme + "://" + Request.Url.Host;
        }

    }
}